package xyz.zhzby.cyzx.judge.messenger;

import io.swagger.annotations.ApiModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author zby
 * @date 2022/02/04
 */
@Component
@ApiModel("MQ消息发送类")
public class MessageSender {

    @Autowired
    private JmsTemplate jmsTemplate;

    /**
     * @Param [mapMessage] [key-value格式的消息]
     * @Return void []
     * @Author zby
     * @Date 2022/02/04
     * @Description 发送消息至消息队列.
     */
    public void sendMessage(final Map<String, Object> mapMessage) {
        jmsTemplate.convertAndSend(mapMessage);
    }
}
